// pages/classify/index.js
Page({
 data:{
  items:[],
  children:[],
  isShow:true
 },
  onLoad(){
this.getClassify()
},

  // 获取页面详情
 async getClassify(){
  const res = await wx.http.get('/category/list')
  this.setData({items:res.data.list,children:res.data.list[0].children})
  // console.log(res.data.list);
  },

  // 商品列表
  Listofgoods(e){
    console.log(e.mark.id);
    wx.navigateTo({
      url: '/pages/ListGoods/index?id='+e.mark.id
    })
  },
  // 右侧点击
  onChange(e){
    console.log(e.detail);
   this.setData({children:this.data.items[e.detail].children,isShow:true}) 
   console.log(this.data.children);
   if(this.data.children === undefined){
     this.setData({isShow:false})
   }
  }
})